<?php 
session_start();
if (@$_SESSION['auth'] <> "yes") 
{
header('Location: login.php');
exit(); 
} 

// set timeout period in seconds
$inactive = 600;
// check to see if $_SESSION['timeout'] is set
if (isset($_SESSION['timeout'])) 
{
$session_life = time() - $_SESSION['timeout'];
	if ($session_life > $inactive)
	{
	session_destroy(); 
	header("Location: login.php"); 
	}
}
$_SESSION['timeout'] = time();

?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bugs & Features</title>
<link rel="stylesheet" type="text/css" href="/quotation.css" />
<link rel="shortcut icon" href="../favicon.ico" />


</head>

<body>
<div id="centeredmenu">
 <ul>
      <li><a href="http://www.quotationaday.com/booktest.php" >Home</a></li>
      <li><a href="http://www.quotationaday.com/bookreport.php">Reports</a></li>
      <li><a href="http://www.quotationaday.com/qa.php" class="active">Bugs & Features</a></li>
      <li><a href="http://www.quotationaday.com/requests.php">Requests</a></li>
      <li><a href="http://www.quotationaday.com/about.html">About</a></li>
   </ul>
</div>
<h1>
<img class="banner" height="120px" width="780px" alt="Quotation a Day" src="../sitebanner.png"/>
</h1>




<?php

//connect to database with connection page information

$con = require "connect.php";
if (!$con)
  {
  die('Could not connect to database: ' . mysql_error());
  } 
  
//query database for match

$sqlsqa = mysql_query
( 
"
SELECT qa_id, status, type, priority, details, notes, creation_date FROM qa
WHERE user_id = 1
ORDER BY status,type,qa_id
"
)
;


echo "<p>";
echo "QA List: "."<br/>";
//w.work_id,wi.ISBN,wi.summary,wi.description,wi.year,wo.edition,p.title
	echo "<table cellpadding='4'>";
	echo "<tr>";
	echo "<th>" . "Number" . "</th>";
	echo "<th>" . "Status" . "</th>";
	echo "<th>" . "Type" . "</th>";
	echo "<th>" . "Priority" . "</th>";
	echo "<th>" . "Details" . "</th>";
	echo "<th>" . "Dev Notes" . "</th>";
	echo "<th>" . "Date" . "</th>";
	echo "</tr>";
  while($row = mysql_fetch_array($sqlsqa))
	{
	if ($row[2]==1)
		{
		$Type='Bug';
		}
		else
		{
		$Type='ER';
		}
	if ($row[1]=='A')
		{$Status='Active';}
	else if ($row[1]=='P')
		{$Status='In Progress';}
	else 
		{$Status='Resolved';}
		
	echo "<tr>";
	echo "<td>" . "QA-".$row[0] . "</td>";
	echo "<td>" . $Status . "</td>";
	echo "<td>" . $Type . "</td>";
	echo "<td>" . $row[3] . "</td>";
	echo "<td>" . stripslashes($row[4]) . "</td>";
	echo "<td>" . $row[5] . "</td>";
	echo "<td>" . $row[6] . "</td>";
	echo "<td>" . $row[7] . "</td>";
	echo "<td>" . $row[8] . "</td>";
	echo "</tr>";
	}
	echo "</table>";
	echo "</p>";
	


?>


<p>
<br/>
<br/>
<a href="http://quotationaday.com/login.php"> Login </a> <br/>
<a href="http://quotationaday.com/booktest.php">Home</a> <br/>
<a href="http://quotationaday.com/logout.php"> Logout </a> <br/>
</p>

<p>Questions, comments, bug reports, edit requests? <br/>
Contact the <a href="mailto:admin@quotationaday.com?subject=Quotation%20a%20Day">Administrator</a></p>

</body>
</html>
